<template>
  <div class="table_caozuo">
    <template v-for="(item,index) in btn">
      <el-button
        :key="index"
        @click="handler(index)"
        v-if="item.isShow"
        type="primary"
        style="margin:0 10px 20px 0"
      >{{item.title}}</el-button>
    </template>
    <avue-crud
      ref="crud"
      style="width:100%"
      :page.sync="page"
      :data="loadData"
      :option="tableOption"
      :table-loading="loading"
      @size-change="sizeChange"
      @current-change="currentChange"
      @selection-change="selectionChange"
    >
      <template slot="name" slot-scope="scope">
        <el-button type="text">{{scope.row.name}}</el-button>
      </template>
      <template slot="menu" slot-scope="scope">
        <el-button @click="kucunLs(scope.row)" type="text" icon="el-icon-view">库存流水</el-button>
      </template>
    </avue-crud>
    <el-dialog title="库存流水" :visible.sync="dialogVisible" width="50%">
      <avue-crud
        ref="crud"
        style="width:100%"
        :data="loadData1"
        :option="tableOption1"
        :table-loading="loading1"
      ></avue-crud>
    </el-dialog>
  </div>
</template>

<script src='./list_table.js'></script>

<style lang="scss">
.table_caozuo {
  margin: 10px 0px;
}
</style>